<?xml version="1.0" encoding="UTF-8"?>
<!--=======================================================================
	Copyright:	umlungu consulting (pty) ltd
	Author:		Alan Benington
	Started:	2008-06-14
	Status:		release	
	Version:	2.0.0
	Build:		20080614
	License:	GNU General Public License
	======================================================================= -->

<!--=======================================================================
	Development Notes:
	==================
	20080614:	Initial release.
	=======================================================================	-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:output method="html" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="no" />
	<xsl:include href="../commonX.xsl"/>

	<xsl:variable name="WantGoogle">no</xsl:variable>
	<xsl:variable name="WantGoogleJsApi">no</xsl:variable>
	
<!--=============
	Base template
	============= -->
	<xsl:template match="/">
		<xsl:apply-templates/>
	</xsl:template>

	<xsl:template match="content">
		<html>
		    <xsl:call-template name="htmlHead"/>
			<body>
				<!-- onload event, if required 
				<xsl:attribute name="onload">
					<xsl:text>javascript:x_page.OnLoad();</xsl:text>
				</xsl:attribute>
				-->
				<!-- Header -->
				<xsl:choose>
					<xsl:when test="$device=''">
						<xsl:call-template name="Header"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:call-template name="HeaderPrint"/>
					</xsl:otherwise>
				</xsl:choose>
				<!-- Content -->
				<div id="content">
					<xsl:attribute name="class">
						<xsl:choose>
							<xsl:when test="$device=''"><xsl:text>wid-scn</xsl:text></xsl:when>
							<xsl:otherwise><xsl:text>wid-prn</xsl:text></xsl:otherwise>
						</xsl:choose>
					</xsl:attribute>
					<xsl:choose>
						<xsl:when test="$device=''">
							<div id="left">
								<div id="menu">
									<xsl:apply-templates select="website/menus/menu[@link=$link or menuitem/@link=$link or menuitem/menuitem/@link=$link]" mode="left"/>
								</div>
							</div>
							<div id="right">
								<xsl:call-template name="Content"/>
							</div>
						</xsl:when>
						<xsl:otherwise>
							<div id="print">
								<xsl:call-template name="Content"/>
							</div>
						</xsl:otherwise>
					</xsl:choose>
					<xsl:call-template name='nobrspace'/>
				</div>
				<!-- Footer -->
				<xsl:call-template name="Footer"/>
			</body>
		</html>
	</xsl:template>

	<!--Note: error templates are not currently working -->
	<xsl:template match="error">
		<html>
			<body>
				<xsl:apply-templates/>
			</body>
		</html>
	</xsl:template>

	<xsl:template match="error/Result">
		<xsl:apply-templates/>
	</xsl:template>

	<xsl:template match="error/Result/Result_Code">
		<h1><xsl:apply-templates/></h1>
	</xsl:template>

	<xsl:template match="error/Result/Description">
		<h2><xsl:apply-templates/></h2>
	</xsl:template>

	<xsl:template match="error/Result/Result_Trace">
		<p><xsl:apply-templates/></p>
	</xsl:template>

<!--=======================
	Named templates section
	======================= -->
	
	
</xsl:stylesheet>
